<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

$route['default_controller'] = "welcome";
$route['404_override']       = '';
$route['services']           = 'services/index/123';


require_once( BASEPATH .'database/DB'. EXT );

$db =& DB();
$db->where('parentId', 0);
$query = $db->get( 'pj_services' );
$result = $query->result();
foreach( $result as $row )
{
    $route[ $row->slug ] = 'services/index/'.$row->slug;
    
    $db->where('parentId', $row->servicesId);
    $query = $db->get( 'pj_services' );
    $rs = $query->result();
    foreach($rs as $sub) {
        $route[ $row->slug.'/'.$sub->slug ] = 'sub/index/'.$sub->slug;
    }
}

$query = $db->get( 'pj_projects' );
$result = $query->result();
foreach( $result as $row )
{
    $route[ $row->slug ] = 'project/view/'.$row->slug;
}

$query = $db->get( 'pj_galleries' );
$result = $query->result();
foreach( $result as $row )
{
    $route[ $row->slug ] = 'gallery/view/'.$row->slug;
}

$query = $db->get( 'pj_entries' );
$result = $query->result();
foreach( $result as $row )
{
    $route[ $row->slug ] = 'blog/view/'.$row->slug;
}

$query = $db->get( 'pj_informations' );
$result = $query->result();
foreach( $result as $row )
{
    $route[ $row->slug ] = 'info/view/'.$row->slug;
}